<% if @request_and_complaint_complaints.size > 0 %>
<br />

<table class="paginated_table sorted_table">
  <thead>
  <tr>
    <th>ID</th>
    <th>Tipo de Denuncia</th>
     <th>Nombre</th>
      <th>DNI</th>
    <th>Descripcion</th>
    <th>Estado</th>
    <th>Fecha de Registro</th>
    <%#*<th></th>%>
    <th></th>
  </tr>
  </thead>

<% @request_and_complaint_complaints.each do |request_and_complaint_complaint| %>
  <tbody>
  <tr>
    <td><%= request_and_complaint_complaint.id %></td>
    <td><%= request_and_complaint_complaint.obj_complaint_type.name %></td>
     <td><%= request_and_complaint_complaint.name%></td>
       <td><%= request_and_complaint_complaint.dni%></td>
    <td><%= request_and_complaint_complaint.description %></td>
    <td><%= request_and_complaint_complaint.str_state %></td>
    <td><%= request_and_complaint_complaint.created_at %></td>
    <td>






      <%= link_to image_tag("navi/search-16-ns.png", :border => 0, :title => 'Mostrar'), {:action => 'show',:id => request_and_complaint_complaint.id}%>
      <% if request_and_complaint_complaint.state==0 or request_and_complaint_complaint.state==3 %>
      <%= link_to image_tag("navi/badge-square-check-16-ns.png", :border => 0, :title => 'Atender'), {:action => 'aprove',:id => request_and_complaint_complaint.id}, {:confirm => '¿Realmente desea atender esta solicitud de denuncia?'}%>
      <%= link_to image_tag("navi/badge-square-minus-16-ns.png", :border => 0, :title => 'Rechazar'), {:action => 'reject',:id => request_and_complaint_complaint.id}, {:confirm => '¿Realmente desea rechazar esta solicitud de denuncia?'}%>     

       <% if user_signed_in? && [2].include?(current_user.role) %>

              <%#= link_to image_tag("navi/badge-square-minus-16-ns.png", :border => 0, :title => 'Asignar'), {:action => 'assign',:id => request_and_complaint_complaint.id}, {:confirm => '¿Realmente desea asignar esta solicitud de denuncia?'}%>
                <%= link_to image_tag("navi/badge-square-check-16-ns.png", :border => 0, :title => 'Asignar'), {:action => 'assign',:id => request_and_complaint_complaint.id, :complaint_responsible => "replace_user_id"}, {:confirm => '¿Realmente desea asignar esta solicitud de denuncia?', :class=>"asign_complaint"}%>
        <%end%>

    <%end%>
    </td>
  </tr>
  </tbody>
<% end %>
</table>
<% else %>
  <p>Ninguna denuncia encontrada</p>

<% end %>